<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>LS.Animation.Track</title>
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="icon" href="../assets/favicon.ico">
    <script src="http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script>
</head>
<body class="yui3-skin-sam">

<div id="doc">
    <div id="hd" class="yui3-g header">
        <div class="yui3-u-3-4">
                <h1><img src="../assets/css/logo.png" title="" width="117" height="52"></h1>
        </div>
        <div class="yui3-u-1-4 version">
            <em>API Docs for: </em>
        </div>
    </div>
    <div id="bd" class="yui3-g">

        <div class="yui3-u-1-4">
            <div id="docs-sidebar" class="sidebar apidocs">
                <div id="api-list">
                    <h2 class="off-left">APIs</h2>
                    <div id="api-tabview" class="tabview">
                        <ul class="tabs">
                            <li><a href="#api-classes">Classes</a></li>
                            <li><a href="#api-modules">Modules</a></li>
                        </ul>
                
                        <div id="api-tabview-filter">
                            <input type="search" id="api-filter" placeholder="Type to filter APIs">
                        </div>
                
                        <div id="api-tabview-panel">
                            <ul id="api-classes" class="apis classes">
                                <li><a href="../classes/LS.Animation.html">LS.Animation</a></li>
                                <li><a href="../classes/LS.Animation.Take.html">LS.Animation.Take</a></li>
                                <li><a href="../classes/LS.Animation.Track.html">LS.Animation.Track</a></li>
                                <li><a href="../classes/LS.BaseComponent.html">LS.BaseComponent</a></li>
                                <li><a href="../classes/LS.Collision.html">LS.Collision</a></li>
                                <li><a href="../classes/LS.ComponentContainer.html">LS.ComponentContainer</a></li>
                                <li><a href="../classes/LS.Components.Camera.html">LS.Components.Camera</a></li>
                                <li><a href="../classes/LS.Components.CameraController.html">LS.Components.CameraController</a></li>
                                <li><a href="../classes/LS.Components.CameraDirector.html">LS.Components.CameraDirector</a></li>
                                <li><a href="../classes/LS.Components.CameraFX.html">LS.Components.CameraFX</a></li>
                                <li><a href="../classes/LS.Components.Canvas3D.html">LS.Components.Canvas3D</a></li>
                                <li><a href="../classes/LS.Components.CustomData.html">LS.Components.CustomData</a></li>
                                <li><a href="../classes/LS.Components.FollowNode.html">LS.Components.FollowNode</a></li>
                                <li><a href="../classes/LS.Components.FrameFX.html">LS.Components.FrameFX</a></li>
                                <li><a href="../classes/LS.Components.FXGraphComponent.html">LS.Components.FXGraphComponent</a></li>
                                <li><a href="../classes/LS.Components.FXStack.html">LS.Components.FXStack</a></li>
                                <li><a href="../classes/LS.Components.GeometricPrimitive.html">LS.Components.GeometricPrimitive</a></li>
                                <li><a href="../classes/LS.Components.GraphComponent.html">LS.Components.GraphComponent</a></li>
                                <li><a href="../classes/LS.Components.Light.html">LS.Components.Light</a></li>
                                <li><a href="../classes/LS.Components.LightFX.html">LS.Components.LightFX</a></li>
                                <li><a href="../classes/LS.Components.LinesRenderer.html">LS.Components.LinesRenderer</a></li>
                                <li><a href="../classes/LS.Components.MeshRenderer.html">LS.Components.MeshRenderer</a></li>
                                <li><a href="../classes/LS.Components.NodeManipulator.html">LS.Components.NodeManipulator</a></li>
                                <li><a href="../classes/LS.Components.ParticlesEmissor.html">LS.Components.ParticlesEmissor</a></li>
                                <li><a href="../classes/LS.Components.PlayAnimation.html">LS.Components.PlayAnimation</a></li>
                                <li><a href="../classes/LS.Components.Poser.html">LS.Components.Poser</a></li>
                                <li><a href="../classes/LS.Components.RealtimeReflector.html">LS.Components.RealtimeReflector</a></li>
                                <li><a href="../classes/LS.Components.Rotator.html">LS.Components.Rotator</a></li>
                                <li><a href="../classes/LS.Components.SceneInclude.html">LS.Components.SceneInclude</a></li>
                                <li><a href="../classes/LS.Components.Script.html">LS.Components.Script</a></li>
                                <li><a href="../classes/LS.Components.SkinDeformer.html">LS.Components.SkinDeformer</a></li>
                                <li><a href="../classes/LS.Components.Skybox.html">LS.Components.Skybox</a></li>
                                <li><a href="../classes/LS.Components.Spline.html">LS.Components.Spline</a></li>
                                <li><a href="../classes/LS.Components.SVGRenderer.html">LS.Components.SVGRenderer</a></li>
                                <li><a href="../classes/LS.Components.Target.html">LS.Components.Target</a></li>
                                <li><a href="../classes/LS.Components.Transform.html">LS.Components.Transform</a></li>
                                <li><a href="../classes/LS.Components.VRCameraController.html">LS.Components.VRCameraController</a></li>
                                <li><a href="../classes/LS.CompositePattern.html">LS.CompositePattern</a></li>
                                <li><a href="../classes/LS.DebugRender.html">LS.DebugRender</a></li>
                                <li><a href="../classes/LS.Draw.html">LS.Draw</a></li>
                                <li><a href="../classes/LS.Formats.html">LS.Formats</a></li>
                                <li><a href="../classes/LS.GLSLCode.html">LS.GLSLCode</a></li>
                                <li><a href="../classes/LS.GraphCode.html">LS.GraphCode</a></li>
                                <li><a href="../classes/LS.GUI.html">LS.GUI</a></li>
                                <li><a href="../classes/LS.Input.html">LS.Input</a></li>
                                <li><a href="../classes/LS.InteractiveController.html">LS.InteractiveController</a></li>
                                <li><a href="../classes/LS.Knob.html">LS.Knob</a></li>
                                <li><a href="../classes/LS.LS.html">LS.LS</a></li>
                                <li><a href="../classes/LS.LScript.html">LS.LScript</a></li>
                                <li><a href="../classes/LS.Material.html">LS.Material</a></li>
                                <li><a href="../classes/LS.oldStandardMaterial.html">LS.oldStandardMaterial</a></li>
                                <li><a href="../classes/LS.Pack.html">LS.Pack</a></li>
                                <li><a href="../classes/LS.Particle.html">LS.Particle</a></li>
                                <li><a href="../classes/LS.Physics.html">LS.Physics</a></li>
                                <li><a href="../classes/LS.PhysicsInstance.html">LS.PhysicsInstance</a></li>
                                <li><a href="../classes/LS.Picking.html">LS.Picking</a></li>
                                <li><a href="../classes/LS.Player.html">LS.Player</a></li>
                                <li><a href="../classes/LS.Prefab.html">LS.Prefab</a></li>
                                <li><a href="../classes/LS.Project.html">LS.Project</a></li>
                                <li><a href="../classes/LS.Ray.html">LS.Ray</a></li>
                                <li><a href="../classes/LS.Renderer.html">LS.Renderer</a></li>
                                <li><a href="../classes/LS.RenderFrameContext.html">LS.RenderFrameContext</a></li>
                                <li><a href="../classes/LS.RenderInstance.html">LS.RenderInstance</a></li>
                                <li><a href="../classes/LS.RenderSettings.html">LS.RenderSettings</a></li>
                                <li><a href="../classes/LS.RenderState.html">LS.RenderState</a></li>
                                <li><a href="../classes/LS.Resource.html">LS.Resource</a></li>
                                <li><a href="../classes/LS.ResourcesManager.html">LS.ResourcesManager</a></li>
                                <li><a href="../classes/LS.Scene.html">LS.Scene</a></li>
                                <li><a href="../classes/LS.SceneNode.html">LS.SceneNode</a></li>
                                <li><a href="../classes/LS.ShaderBlock.html">LS.ShaderBlock</a></li>
                                <li><a href="../classes/LS.ShaderCode.html">LS.ShaderCode</a></li>
                                <li><a href="../classes/LS.ShaderGraph.html">LS.ShaderGraph</a></li>
                                <li><a href="../classes/LS.ShaderMaterial.html">LS.ShaderMaterial</a></li>
                                <li><a href="../classes/LS.Shaders.html">LS.Shaders</a></li>
                                <li><a href="../classes/LS.SpatialContainer.html">LS.SpatialContainer</a></li>
                                <li><a href="../classes/LS.StandardMaterial.html">LS.StandardMaterial</a></li>
                                <li><a href="../classes/LS.Tween.html">LS.Tween</a></li>
                                <li><a href="../classes/LS.UnityMaterial.html">LS.UnityMaterial</a></li>
                                <li><a href="../classes/LS.WBin.html">LS.WBin</a></li>
                                <li><a href="../classes/LSQ.html">LSQ</a></li>
                            </ul>
                
                
                            <ul id="api-modules" class="apis modules">
                                <li><a href="../modules/LS.html">LS</a></li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="yui3-u-3-4">
                <div id="api-options">
                    Show:
                    <label for="api-show-inherited">
                        <input type="checkbox" id="api-show-inherited" checked>
                        Inherited
                    </label>
            
                    <label for="api-show-protected">
                        <input type="checkbox" id="api-show-protected">
                        Protected
                    </label>
            
                    <label for="api-show-private">
                        <input type="checkbox" id="api-show-private">
                        Private
                    </label>
                    <label for="api-show-deprecated">
                        <input type="checkbox" id="api-show-deprecated">
                        Deprecated
                    </label>
            
                </div>
            
            <div class="apidocs">
                <div id="docs-main">
                    <div class="content">
<h1>LS.Animation.Track Class</h1>
<div class="box meta">


        <div class="foundat">
            Defined in: <a href="../files/.._src_resources_animation.js.html#l704"><code>..&#x2F;src&#x2F;resources&#x2F;animation.js:704</code></a>
        </div>

            Module: <a href="../modules/LS.html">LS</a>

</div>


<div class="box intro">
    <p>Represents one track with data over time about one property
Data could be stored in two forms, or an array containing arrays of [time,data] (unpacked data) or in a single typed array (packed data), depends on the attribute typed_mode</p>

</div>

    <div class="constructor">
        <h2>Constructor</h2>
<div id="method_LS.Animation.Track" class="method item">
    <h3 class="name"><code>LS.Animation.Track</code></h3>

        <span class="paren">()</span>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_resources_animation.js.html#l704"><code>..&#x2F;src&#x2F;resources&#x2F;animation.js:704</code></a>
        </p>



    </div>

    <div class="description">
        
    </div>




</div>
    </div>

<div id="classdocs" class="tabview">
    <ul class="api-class-tabs">
        <li class="api-class-tab index"><a href="#index">Index</a></li>

            <li class="api-class-tab methods"><a href="#methods">Methods</a></li>
            <li class="api-class-tab properties"><a href="#properties">Properties</a></li>
    </ul>

    <div>
        <div id="index" class="api-class-tabpanel index">
            <h2 class="off-left">Item Index</h2>

                <div class="index-section methods">
                    <h3>Methods</h3>

                    <ul class="index-list methods">
                            <li class="index-item method">
                                <a href="#method_addKeyframe">addKeyframe</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_convertToTrans10">convertToTrans10</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_findTimeIndex">findTimeIndex</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_getIDasName">getIDasName</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_getKeyframe">getKeyframe</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_getKeyframeByTime">getKeyframeByTime</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_getNumberOfKeyframes">getNumberOfKeyframes</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_getPropertyInfo">getPropertyInfo</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_getSample">getSample</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_getSampledData">getSampledData</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_moveKeyframe">moveKeyframe</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_packData">packData</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_removeKeyframe">removeKeyframe</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_removeScaling">removeScaling</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_sortKeyframes">sortKeyframes</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_stretch">stretch</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_trim">trim</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_unpackData">unpackData</a>

                            </li>
                    </ul>
                </div>

                <div class="index-section properties">
                    <h3>Properties</h3>

                    <ul class="index-list properties">
                            <li class="index-item property">
                                <a href="#property_data  contains all the keyframes, could be an array or a typed array">data  contains all the keyframes, could be an array or a typed array</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_enabled  if it must be applied">enabled  if it must be applied</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_interpolation  type of interpolation LS.NONE, LS.LINEAR, LS.TRIGONOMETRIC, LS.BEZIER, LS.SPLICE">interpolation  type of interpolation LS.NONE, LS.LINEAR, LS.TRIGONOMETRIC, LS.BEZIER, LS.SPLICE</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_looped  if the last and the first keyframe should be connected">looped  if the last and the first keyframe should be connected</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_name  title to show in the editor">name  title to show in the editor</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_property  the locator to the property this track should modify ( &quot;node/component_uid/property&quot; )">property  the locator to the property this track should modify ( &quot;node/component_uid/property&quot; )</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_type  if the data is number, vec2, color, etc">type  if the data is number, vec2, color, etc</a>

                            </li>
                    </ul>
                </div>


        </div>

            <div id="methods" class="api-class-tabpanel">
                <h2 class="off-left">Methods</h2>

<div id="method_addKeyframe" class="method item">
    <h3 class="name"><code>addKeyframe</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>time</code>
                </li>
                <li class="arg">
                        <code>value</code>
                </li>
                <li class="arg">
                        <code>skip_replace</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Number</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_resources_animation.js.html#l948"><code>..&#x2F;src&#x2F;resources&#x2F;animation.js:948</code></a>
        </p>



    </div>

    <div class="description">
        <p>Adds a new keyframe to this track</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">time</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                        <p>time stamp in seconds</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">value</code>
                        <span class="type"></span>


                    <div class="param-description">
                        <p>anything you want to store</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">skip_replace</code>
                        <span class="type">Boolean</span>


                    <div class="param-description">
                        <p>if you want to replace existing keyframes at same time stamp or add it next to that</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Number</span>:
                    <p>index of keyframe</p>

            </div>
        </div>


</div>
<div id="method_convertToTrans10" class="method item">
    <h3 class="name"><code>convertToTrans10</code></h3>

        <span class="paren">()</span>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_resources_animation.js.html#l1550"><code>..&#x2F;src&#x2F;resources&#x2F;animation.js:1550</code></a>
        </p>



    </div>

    <div class="description">
        <p>If the track used matrices, it transform them to position,quaternion and scale (10 floats, also known as trans10)
this makes working with animations faster</p>

    </div>




</div>
<div id="method_findTimeIndex" class="method item">
    <h3 class="name"><code>findTimeIndex</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>time</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Number</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_resources_animation.js.html#l1198"><code>..&#x2F;src&#x2F;resources&#x2F;animation.js:1198</code></a>
        </p>



    </div>

    <div class="description">
        <p>Returns nearest index of keyframe with time equal or less to specified time (Dichotimic search)</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">time</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Number</span>:
                    <p>the nearest index (lower-bound)</p>

            </div>
        </div>


</div>
<div id="method_getIDasName" class="method item">
    <h3 class="name"><code>getIDasName</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>use_basename</code>
                </li>
                <li class="arg">
                        <code>root</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">String</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_resources_animation.js.html#l883"><code>..&#x2F;src&#x2F;resources&#x2F;animation.js:883</code></a>
        </p>



    </div>

    <div class="description">
        <p>used to change every track so instead of using UIDs for properties it uses node names
this is used when you want to apply the same animation to different nodes in the scene</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">use_basename</code>
                        <span class="type">Boolean</span>


                    <div class="param-description">
                        <p>if you want to just use the node name, othewise it uses the fullname (name with path)</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">root</code>
                        <span class="type"><a href="../classes/LS.SceneNode.html" class="crosslink">LS.SceneNode</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">String</span>:
                    <p>the result name</p>

            </div>
        </div>


</div>
<div id="method_getKeyframe" class="method item">
    <h3 class="name"><code>getKeyframe</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>index</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Array</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_resources_animation.js.html#l982"><code>..&#x2F;src&#x2F;resources&#x2F;animation.js:982</code></a>
        </p>



    </div>

    <div class="description">
        <p>returns a keyframe given an index</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">index</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Array</span>:
                    <p>the keyframe in [time,data] format</p>

            </div>
        </div>


</div>
<div id="method_getKeyframeByTime" class="method item">
    <h3 class="name"><code>getKeyframeByTime</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>time</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Array</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_resources_animation.js.html#l1008"><code>..&#x2F;src&#x2F;resources&#x2F;animation.js:1008</code></a>
        </p>



    </div>

    <div class="description">
        <p>returns the first keyframe that matches this time</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">time</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Array</span>:
                    <p>keyframe in [time,value]</p>

            </div>
        </div>


</div>
<div id="method_getNumberOfKeyframes" class="method item">
    <h3 class="name"><code>getNumberOfKeyframes</code></h3>

        <span class="paren">()</span>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_resources_animation.js.html#l1101"><code>..&#x2F;src&#x2F;resources&#x2F;animation.js:1101</code></a>
        </p>



    </div>

    <div class="description">
        <p>returns the number of keyframes</p>

    </div>




</div>
<div id="method_getPropertyInfo" class="method item">
    <h3 class="name"><code>getPropertyInfo</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>scene</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Object</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_resources_animation.js.html#l1464"><code>..&#x2F;src&#x2F;resources&#x2F;animation.js:1464</code></a>
        </p>



    </div>

    <div class="description">
        <p>returns information about the object being affected by this track based on its locator
the object contains a reference to the object, the property name, the type of the data</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">scene</code>
                        <span class="type"><a href="../classes/LS.Scene.html" class="crosslink">LS.Scene</a></span>


                    <div class="param-description">
                        <p>[optional]</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Object</span>:
                    <p>an object with the info { target, name, type, value }</p>

            </div>
        </div>


</div>
<div id="method_getSample" class="method item">
    <h3 class="name"><code>getSample</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>time</code>
                </li>
                <li class="arg">
                        <code>interpolation</code>
                </li>
                <li class="arg">
                        <code>result</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type"></span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_resources_animation.js.html#l1288"><code>..&#x2F;src&#x2F;resources&#x2F;animation.js:1288</code></a>
        </p>



    </div>

    <div class="description">
        <p>Samples the data in one time, taking into account interpolation.
Warning: if no result container is provided the same container is reused between samples to avoid garbage, be careful.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">time</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">interpolation</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                        <p>[optional] the interpolation method could be LS.NONE, LS.LINEAR, LS.BEZIER</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">result</code>
                        <span class="type"></span>


                    <div class="param-description">
                        <p>[optional] the container where to store the data (in case is an array). IF NOT CONTAINER IS PROVIDED THE SAME ONE IS RETURNED EVERY TIME!</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type"></span>:
                    <p>data</p>

            </div>
        </div>


</div>
<div id="method_getSampledData" class="method item">
    <h3 class="name"><code>getSampledData</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>start_time</code>
                </li>
                <li class="arg">
                        <code>end_time</code>
                </li>
                <li class="arg">
                        <code>num_samples</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Array</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_resources_animation.js.html#l1478"><code>..&#x2F;src&#x2F;resources&#x2F;animation.js:1478</code></a>
        </p>



    </div>

    <div class="description">
        <p>returns an array containing N samples for this property over time using the interpolation of the track</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">start_time</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                        <p>when to start sampling</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">end_time</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                        <p>when to finish sampling</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">num_samples</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                        <p>the number of samples</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Array</span>:
                    <p>an array containing all the samples</p>

            </div>
        </div>


</div>
<div id="method_moveKeyframe" class="method item">
    <h3 class="name"><code>moveKeyframe</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>index</code>
                </li>
                <li class="arg">
                        <code>new_time</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Number</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_resources_animation.js.html#l1022"><code>..&#x2F;src&#x2F;resources&#x2F;animation.js:1022</code></a>
        </p>



    </div>

    <div class="description">
        <p>changes a keyframe time and rearranges it</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">index</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">new_time</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Number</span>:
                    <p>new index</p>

            </div>
        </div>


</div>
<div id="method_packData" class="method item">
    <h3 class="name"><code>packData</code></h3>

        <span class="paren">()</span>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_resources_animation.js.html#l1143"><code>..&#x2F;src&#x2F;resources&#x2F;animation.js:1143</code></a>
        </p>



    </div>

    <div class="description">
        <p>takes all the keyframes and stores them inside a typed-array so they are faster to store in server or work with</p>

    </div>




</div>
<div id="method_removeKeyframe" class="method item">
    <h3 class="name"><code>removeKeyframe</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>index</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_resources_animation.js.html#l1082"><code>..&#x2F;src&#x2F;resources&#x2F;animation.js:1082</code></a>
        </p>



    </div>

    <div class="description">
        <p>removes one keyframe</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">index</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_removeScaling" class="method item">
    <h3 class="name"><code>removeScaling</code></h3>

        <span class="paren">()</span>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_resources_animation.js.html#l1589"><code>..&#x2F;src&#x2F;resources&#x2F;animation.js:1589</code></a>
        </p>



    </div>

    <div class="description">
        <p>If this track changes the scale, it forces it to be 1,1,1</p>

    </div>




</div>
<div id="method_sortKeyframes" class="method item">
    <h3 class="name"><code>sortKeyframes</code></h3>

        <span class="paren">()</span>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_resources_animation.js.html#l1067"><code>..&#x2F;src&#x2F;resources&#x2F;animation.js:1067</code></a>
        </p>



    </div>

    <div class="description">
        <p>Sometimes when moving keyframes they could end up not sorted by timestamp, which will cause problems when sampling, to avoid it, we can force to sort all keyframes</p>

    </div>




</div>
<div id="method_stretch" class="method item">
    <h3 class="name"><code>stretch</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>scale</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_resources_animation.js.html#l1535"><code>..&#x2F;src&#x2F;resources&#x2F;animation.js:1535</code></a>
        </p>



    </div>

    <div class="description">
        <p>Scales the time in every keyframe</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">scale</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                        <p>the sacle to apply to all times</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_trim" class="method item">
    <h3 class="name"><code>trim</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>start</code>
                </li>
                <li class="arg">
                        <code>end</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_resources_animation.js.html#l1505"><code>..&#x2F;src&#x2F;resources&#x2F;animation.js:1505</code></a>
        </p>



    </div>

    <div class="description">
        <p>removes keyframes that are before or after the time range</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">start</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                        <p>time</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">end</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                        <p>time</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_unpackData" class="method item">
    <h3 class="name"><code>unpackData</code></h3>

        <span class="paren">()</span>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_resources_animation.js.html#l1175"><code>..&#x2F;src&#x2F;resources&#x2F;animation.js:1175</code></a>
        </p>



    </div>

    <div class="description">
        <p>takes all the keyframes and unpacks them so they are in a simple array, easier to work with</p>

    </div>




</div>
            </div>

            <div id="properties" class="api-class-tabpanel">
                <h2 class="off-left">Properties</h2>

<div id="property_data  contains all the keyframes, could be an array or a typed array" class="property item">
    <h3 class="name"><code>data  contains all the keyframes, could be an array or a typed array</code></h3>
    <span class="type"></span>





    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_resources_animation.js.html#l740"><code>..&#x2F;src&#x2F;resources&#x2F;animation.js:740</code></a>
        </p>


    </div>

    <div class="description">
        
    </div>



</div>
<div id="property_enabled  if it must be applied" class="property item">
    <h3 class="name"><code>enabled  if it must be applied</code></h3>
    <span class="type">Boolean</span>





    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_resources_animation.js.html#l715"><code>..&#x2F;src&#x2F;resources&#x2F;animation.js:715</code></a>
        </p>


    </div>

    <div class="description">
        
    </div>



</div>
<div id="property_interpolation  type of interpolation LS.NONE, LS.LINEAR, LS.TRIGONOMETRIC, LS.BEZIER, LS.SPLICE" class="property item">
    <h3 class="name"><code>interpolation  type of interpolation LS.NONE, LS.LINEAR, LS.TRIGONOMETRIC, LS.BEZIER, LS.SPLICE</code></h3>
    <span class="type">Number</span>





    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_resources_animation.js.html#l728"><code>..&#x2F;src&#x2F;resources&#x2F;animation.js:728</code></a>
        </p>


    </div>

    <div class="description">
        
    </div>



</div>
<div id="property_looped  if the last and the first keyframe should be connected" class="property item">
    <h3 class="name"><code>looped  if the last and the first keyframe should be connected</code></h3>
    <span class="type">Boolean</span>





    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_resources_animation.js.html#l732"><code>..&#x2F;src&#x2F;resources&#x2F;animation.js:732</code></a>
        </p>


    </div>

    <div class="description">
        
    </div>



</div>
<div id="property_name  title to show in the editor" class="property item">
    <h3 class="name"><code>name  title to show in the editor</code></h3>
    <span class="type">String</span>





    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_resources_animation.js.html#l719"><code>..&#x2F;src&#x2F;resources&#x2F;animation.js:719</code></a>
        </p>


    </div>

    <div class="description">
        
    </div>



</div>
<div id="property_property  the locator to the property this track should modify ( &quot;node/component_uid/property&quot; )" class="property item">
    <h3 class="name"><code>property  the locator to the property this track should modify ( &quot;node/component_uid/property&quot; )</code></h3>
    <span class="type">String</span>





    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_resources_animation.js.html#l771"><code>..&#x2F;src&#x2F;resources&#x2F;animation.js:771</code></a>
        </p>


    </div>

    <div class="description">
        
    </div>



</div>
<div id="property_type  if the data is number, vec2, color, etc" class="property item">
    <h3 class="name"><code>type  if the data is number, vec2, color, etc</code></h3>
    <span class="type">String</span>





    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_resources_animation.js.html#l723"><code>..&#x2F;src&#x2F;resources&#x2F;animation.js:723</code></a>
        </p>


    </div>

    <div class="description">
        
    </div>



</div>
            </div>


    </div>
</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../assets/../api.js"></script>
<script src="../assets/js/api-filter.js"></script>
<script src="../assets/js/api-list.js"></script>
<script src="../assets/js/api-search.js"></script>
<script src="../assets/js/apidocs.js"></script>
</body>
</html>
